﻿@using GameSchool.HtmlHelpers
@model GameSchool.Models.AccountModels.ChangePasswordModel
@{
    ViewBag.Title = "Breyta lykilorði";
}
<h2>
    Breyta lykilorði</h2>
<p>
    Notaðu formið hér fyrir neðan til þess að breyta lykilorði fyrir notandann "@ViewBag.UserName".
</p>
<p>
    Ný lykilorð þurfa að vera að minnsta kosti @Membership.MinRequiredPasswordLength stafir að lengd.
</p>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm(htmlAttributes: new { @class = "form-horizontal" }))
{
    @Html.ValidationSummary(true, "Ekki tókst að breyta lykilorði. Vinsamlega farðu yfir innskráð gildi og reyndu aftur.")
    <div>
        <fieldset>
            <legend>Lykilorðsupplýsingar</legend>
            <div class="control-group">
                @Html.LabelFor(m => m.OldPassword, new { @class = "control-label" })
                <div class="controls">
                    @Html.PasswordFor(m => m.OldPassword, new { @class = "input-xlarge" })
                    @Html.ValidationMessageFor(m => m.OldPassword)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.NewPassword, new { @class = "control-label" })
                <div class="controls">
                    @Html.PasswordFor(m => m.NewPassword, new { @class = "input-xlarge" })
                    @Html.ValidationMessageFor(m => m.NewPassword)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(m => m.ConfirmPassword, new { @class = "control-label" })
                <div class="controls">
                    @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "input-xlarge" })
                    @Html.ValidationMessageFor(m => m.ConfirmPassword)
                </div>
            </div>
            <div class="form-actions">
                <input type="submit" class="btn btn-primary" value="Uppfæra lykilorð" />
                <a href="@Url.Action("List")" class="btn">Til baka í notendalista</a>
            </div>
        </fieldset>
    </div>
}
